home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / console / svgatext.3 / svgatext / SVGATextMode-1.3 / dump_cfgdata.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-05  |  4.3 KB  |  140 lines

  1. /*  SVGATextMode -- An SVGA textmode manipulation/enhancement tool
  2.  *
  3.  *  Copyright (C) 1995,1996  Koen Gadeyne
  4.  *
  5.  *  This program is free software; you can redistribute it and/or modify
  6.  *  it under the terms of the GNU General Public License as published by
  7.  *  the Free Software Foundation; either version 2 of the License, or
  8.  *  (at your option) any later version.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU General Public License
  16.  *  along with this program; if not, write to the Free Software
  17.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  */
  19.  
  20.  
  21. /***
  22.  *** dump_cfg_data.c: debugging function. Dumps config file data.
  23.  ***/
  24.  
  25.  
  26. #include <stdio.h>
  27. #include "misc.h"
  28. #include "chipset.h"
  29. #include "messages.h"
  30.  
  31. #define NOTDEFINED "(Not Defined)"
  32.  
  33. void dump_mode(t_mode *m)
  34. {
  35.    PDEBUG(("  `%s' [%dx%d]  %dkHz  %d %d %d %d  %d %d %d %d  font %dx%d  flags=0x%X  H/V=%.1f/%.1f\n",\
  36.       m->name,\
  37.       m->cols, m->rows, \
  38.       m->pixelClock,\
  39.       m->HDisplay, m->HSyncStart, m->HSyncEnd, m->HTotal,\
  40.       m->VDisplay, m->VSyncStart, m->VSyncEnd, m->VTotal,\
  41.       m->FontWidth, m->FontHeight,\
  42.       m->flags,\
  43.       m->hfreq/1000.0, m->vfreq/1000.0\
  44.     ));
  45. }
  46.  
  47. void dump_cfgdata(int dbg_lev)
  48. {
  49.   int i;
  50.   t_mode *curr_textmode;
  51.   t_mon_timing *curr_tim;
  52.   t_terminals *curr_term;
  53.   
  54.   if (dbg_lev>0)
  55.   {
  56.     PDEBUG(("parsed data from config file:\n"));
  57.     PDEBUG(("Chipset = %d (%s)\n", chipset, ChipsetRec[chipset].name_str));
  58.     
  59.     if (dbg_lev>1)
  60.     {
  61.       PDEBUG(("Modelines:\n"));
  62.       curr_textmode = text_mode_list;
  63.       while (curr_textmode) 
  64.       {
  65.         dump_mode(curr_textmode);
  66.         curr_textmode = curr_textmode->next;
  67.       }
  68.     }
  69.  
  70.     PDEBUG(("monitor H limits:"));
  71.     curr_tim = h_mon_limits;
  72.     while (curr_tim)
  73.     {
  74.       fprintf(stderr, " %d - %d %c", curr_tim->low_limit, curr_tim->high_limit, curr_tim->next ? ',' : '\n');
  75.       curr_tim = curr_tim->next;
  76.     }
  77.     
  78.     PDEBUG(("monitor V limits:"));
  79.     curr_tim = v_mon_limits;
  80.     while (curr_tim)
  81.     {
  82.       fprintf(stderr, " %d - %d %c", curr_tim->low_limit, curr_tim->high_limit, curr_tim->next ? ',' : '\n');
  83.       curr_tim = curr_tim->next;
  84.     }
  85.  
  86.     PDEBUG(("Clocks:"));
  87.     for (i=0; i<clock_data.num_clocks; i++) fprintf(stderr," %d", clock_data.clocks[i]);
  88.     fputc('\n', stderr);
  89.     
  90.     PDEBUG(("DacSpeed = %dkHz\n", clock_data.maxclock));
  91.  
  92.     if (clock_data.mclk!=MCLK_NOT_DEFINED) PDEBUG(("MClk     = %dkHz\n", clock_data.mclk));
  93.       else PDEBUG(("MClk not defined\n"));
  94.  
  95.     if (clock_data.refclk!=REFCLK_NOT_DEFINED) PDEBUG(("RefClk   = %dkHz\n", clock_data.refclk));
  96.       else PDEBUG(("RefClk not defined\n"));
  97.  
  98.     if (clock_data.clockchiptype!=CLKCHIP_NONE)
  99.       PDEBUG(("ClockChip = %d (%s)\n", clock_data.clockchiptype, ClockchipRec[clock_data.clockchiptype].name_str));
  100.       else PDEBUG(("ClockChip not defined\n"));
  101.  
  102.     PDEBUG(("Optmask = 0x%x\n", STM_Options));
  103.  
  104.     PDEBUG(("ResetProg = `%s'\n", resetprogpath ? resetprogpath : NOTDEFINED));
  105.  
  106.     PDEBUG(("DefaultMode = `%s'\n", defaultmode ? defaultmode : NOTDEFINED));
  107.  
  108.     PDEBUG(("Underline_pos = %d%s\n", underline_pos, (underline_pos<0) ? " (disabled)" : ""));
  109.  
  110.     PDEBUG(("ClockProg = `%s'\n", clock_data.ck_prog_path? clock_data.ck_prog_path : NOTDEFINED));
  111.  
  112.     PDEBUG(("Terminals: "));
  113.     if (!(curr_term = p_terminals)) fprintf(stderr,NOTDEFINED);
  114.     while (curr_term)
  115.     {
  116.       fprintf(stderr, "%s ", curr_term->name);
  117.       curr_term = curr_term->next;
  118.     }
  119.     fputc('\n', stderr);
  120.     
  121.     PDEBUG(("cursor_start = %d ; cursor_end = %d\n", cursor_start, cursor_end));
  122.     
  123.     PDEBUG(("bordercolor  = %d\n", bordercolor));
  124.  
  125.     PDEBUG(("FontProg = `%s'\n", font_data.fontprogpath ? font_data.fontprogpath : NOTDEFINED));
  126.     PDEBUG(("FontPath = `%s'\n", font_data.fontpath ? font_data.fontpath : NOTDEFINED));
  127.     
  128.     if (dbg_lev>1)
  129.     {
  130.       PDEBUG(("Font selections:\n"));
  131.       for (i=0; i<32; i++)
  132.       {
  133.         if (font_data.font_table[0][i]) PDEBUG(("8x%d : %s\n", i+1, font_data.font_table[0][i]));
  134.         if (font_data.font_table[1][i]) PDEBUG(("9x%d : %s\n", i+1, font_data.font_table[1][i]));
  135.       }
  136.     }
  137.   
  138.   }
  139. }
  140.